package com.sunye.rabbit_mq_2;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class RabbitBeanListenController {


    @RabbitListener(queues = "messageQueue")
    public void listenRabbitBeanMessage(String message){
        System.out.println("消费者1："+message);
    }


    @RabbitListener(queues = "messageQueue2")
    public void listenRabbitBeanMessage2(String message){
        System.out.println("消费者2："+message);
    }



    @RabbitListener(queues = "directQueue")
    public void directQueue(String message){
        System.out.println("消费者1："+message);
    }


    @RabbitListener(queues = "directQueue2")
    public void directQueue2(String message){
        System.out.println("消费者2："+message);
    }



    @RabbitListener(queues = "topicQueue01")
    public void topicQueue1(String message){
        System.out.println("消费者1 = " + message);
    }

    @RabbitListener(queues = "topicQueue02")
    public void topicQueue2(String message){
        System.out.println("消费者2 = " + message);
    }
}
